Conventional sensors which may be electrical or mechanical have their own drawbacks and are not satisfactory. For example, the electrical sensor suffers from electromagnetic interference and is not essentially explosive-proof. The mechanical sensor not only has complicated structures but also suffers from friction associated with the moving parts.